Skip to content

Frontend: simplify custom predicates interfaces#83

Merged
ax0 merged 2 commits intomainfrom
frontend-custom-predicates
Feb 25, 2025
Merged

Frontend: simplify custom predicates interfaces#83
ax0 merged 2 commits intomainfrom
frontend-custom-predicates

Conversation

@arnaucube
Copy link
Collaborator

@arnaucube arnaucube commented Feb 24, 2025

  • migrate middleware::custom::tests types and structs to frontend::custom, adapt it and add comments detailing logic
  • simplify custom predicate's frontend interfaces, making it less verbose to define Statement Template arguments

The main idea is that when defining the arguments at a statement template, it can be done from 3 different inputs:
i. (&str, literal): this is to set a POD and a field, ie. (POD, literal("field"))
ii. (&str, &str): this is to define a origin-key wildcard pair, ie. (src_origin, src_dest)
iii. Value: this is to define a literal value, ie. 0
(this is documented in the code, and it's usage can be seen at the frontend::custom tests)

This PR is in the direction of #80 .

…se to define Statement Template arguments

The main idea is that when defining the arguments at a statement
template, it can be done from 3 different inputs:
i. `(&str, literal)`: this is to set a POD and a field, ie. `(POD, literal("field")`)
ii. `(&str, &str)`: this is to define a origin-key wildcard pair, ie. `(src_origin, src_dest)`
iii. `Value`: this is to define a literal value, ie. `0`
@arnaucube arnaucube force-pushed the frontend-custom-predicates branch from d734be6 to 22a309b Compare February 24, 2025 15:49
@arnaucube arnaucube requested a review from ax0 February 24, 2025 15:51
@arnaucube arnaucube added this to the Milestone 2 milestone Feb 24, 2025
@arnaucube arnaucube added the frontend Topics: Language, Syntactic Sugar, Usability label Feb 24, 2025
Copy link
Collaborator

@ax0 ax0 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@ax0 ax0 merged commit 538353a into main Feb 25, 2025
4 checks passed
@arnaucube arnaucube mentioned this pull request Mar 3, 2025
3 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

frontend Topics: Language, Syntactic Sugar, Usability

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants